package EX2;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Random;
/*
PrintStream类
 */

public class demo3_4 {
    public static void main(String[] args) throws FileNotFoundException {
        File f=new File("C:/filea/a.txt");
        PrintStream ps=new PrintStream(new FileOutputStream(f));
        Random random=new Random();
        for (int i = 0; i < 5; i++) {
            ps.print(random.nextInt(100)+1);//(int)[1,101)
        }
        ps.close();

    }
}
